<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>账户管理</title>
<link rel="stylesheet"
	href="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="https://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
    
    function updateInfo(name){

    	$.ajax({
    		type:'post',
    		url:'${pageContext.request.contextPath}/userInfo/selectByAccount.action',
    		data:'name='+name,
    		success:function(data){
    			
    			window.location.href="${pageContext.request.contextPath}/jsp/userInfo_update.jsp";
    		} 
    	})
    }

	function changePassword(id) {
		
		 $.ajax({
		   type:'post',
		   url:'${pageContext.request.contextPath}/user/setInfo.action',
		   data:'id='+id,
		   success:function(data){
			   
			   window.location.href="${pageContext.request.contextPath}/user/changePassword.action";
		   }	   
	   })
	}
</script>
</head>
<body>

	<div class="panel panel-default"
		style="width: 850px; margin-top: 30px; margin-left: 20px;">
		<div class="panel-body"
			style="width: 800px; padding: 2px; padding-left: 20px; padding-bottom: 30px;">

			<div class="page-header">
				<h2>个人信息</h2>
			</div>

			<p style="height: 30px; margin-left: 250px; margin-top: 20px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">姓名：</span><input
					type="text" value="${userInfo.name}" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>
			<p style="height: 30px; margin-left: 250px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">电话：</span><input
					type="text" value="${userInfo.tel}" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>
			<p style="height: 30px; margin-left: 250px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">部门：</span><input
					type="text" value="${userInfo.department}" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>
			<p style="height: 30px; margin-left: 250px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">职位：</span><input
					type="text" value="${userInfo.job}" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>



			<button onclick="updateInfo('${userInfo.account}')"
				class="btn btn-info" style="margin-left: 670px; margin-top: 10px;">修改信息</button>


		</div>
	</div>
	<div></div>



	<div class="panel panel-default"
		style="width: 850px; margin-top: 10px; margin-left: 20px;">
		<div class="panel-body"
			style="width: 800px; padding: 2px; padding-left: 20px; padding-bottom: 30px;">

			<div class="page-header">
				<h2>账号信息</h2>
			</div>

			<div class="alert alert-warning"
				style="height: 50px; margin-bottom: 60px;">
				<a href="#" class="close" data-dismiss="alert"> &times; </a>
				为了您的账户安全,请定期修改密码!

			</div>

			<p style="height: 30px; margin-left: 250px; margin-top: 20px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">账号：</span><input
					type="text" value="${userInfo.account}" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>
			<p style="height: 30px; margin-left: 250px;">
				<span
					style="height: 30px; width: 60px; float: left; font-size: 20px;">密码：</span><input
					type="password" value="18758171751" class="form-control"
					style="height: 30px; width: 200px; float: left;">
			</p>


			<div style="margin-left: 570px; margin-top: 70px;">
				<button class="btn btn-info" type="submit"
					onclick="changePassword(${id})">修改密码</button>
				<button class="btn btn-success" type="submit"
					style="margin-left: 10px;">密保管理</button>
			</div>


		</div>
	</div>
	<div></div>



</body>
</html>